const axios = require("axios")
const iconv = require("iconv-lite")
const cheerio = require("cheerio")



class utils {
    async get(url, type = "") {
        let res = (await axios.get(
            url,
            { responseType: 'arraybuffer'}
        )).data;
        return type == "" ? cheerio.load(iconv.decode(res, 'gbk')) : res;
    }
}

module.exports = new utils()